package tps12.axwax.server.data;

import java.util.ArrayList;
import java.util.List;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;


import com.google.appengine.api.datastore.Key;
import com.google.appengine.api.users.User;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class UserSolution {
	public UserSolution(User user, BarredRectangularPuzzle puzzle) {
		userId = user.getUserId();
		this.puzzle = puzzle.getKey();
		letters = "";
		for (int i = 0; i < puzzle.getSize(); i++)
			letters += " ";
		notes = new ArrayList<ClueNote>();
	}
	
    @SuppressWarnings("unused")
	@PrimaryKey
    @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
    private Key key;
    
    @SuppressWarnings("unused")
	@Persistent
    private String userId;
 
    @SuppressWarnings("unused")
	@Persistent
    private Key puzzle;
    
    @Persistent
    private List<ClueNote> notes;
    
    public List<ClueNote> getNotes() { return notes; }
    
    @Persistent
    private String letters;
    
    public String getLetters() { return letters; }
    public void setLetters(String value) { letters = value; }
}
